package com.aforce3.trailertracer;

import javax.vecmath.Color3f;

/** Modeled after the Java3d Material class **/
public class Material
{
	private Color3f ambientColor;
	private Color3f emissiveColor;
	private Color3f diffuseColor;
	private Color3f specularColor;
	float reflectivity;
	float shininess;
	float transparency = 0;
	private static Color3f defaultAmbientColor = new Color3f(1, 0, 0);
	
	
	public Material()
	{
		this(defaultAmbientColor, new Color3f(0.0f, 0.0f, 0.0f), new Color3f(0.2f,0.2f, 0f), new Color3f(1f, 1f, 1f), 0.2f, 30);
	}
	
	public Material(Color3f ambientColor, Color3f emissiveColor, Color3f diffuseColor, Color3f specularColor, float reflectivity, float shininess)
	{
		this.ambientColor = ambientColor;
		this.emissiveColor = emissiveColor;
		this.diffuseColor = diffuseColor;
		this.specularColor = specularColor;
		this.reflectivity = reflectivity;
		this.shininess = shininess;
		this.transparency = 0.5f;
	}
	
	public Material(Color3f ambientColor, Color3f emissiveColor, Color3f diffuseColor, Color3f specularColor, float reflectivity, float shininess, float transparency)
	{
		this.ambientColor = ambientColor;
		this.emissiveColor = emissiveColor;
		this.diffuseColor = diffuseColor;
		this.specularColor = specularColor;
		this.reflectivity = reflectivity;
		this.shininess = shininess;
		this.transparency = transparency;
	}
	
	public static Color3f getDefaultAmbientColor()
	{
		return defaultAmbientColor;
	}
	
	public static void setDefaultAmbientColor(Color3f color)
	{
		defaultAmbientColor = color;
	}
	
	public Color3f getAmbientColor()
	{
		return ambientColor;
	}
	
	public Color3f getEmissiveColor()
	{
		return new Color3f(emissiveColor);
	}
	
	public void setEmissiveColor(Color3f c)
	{
		emissiveColor = c;
	}
	
	public Color3f getSpecularColor()
	{
		return specularColor;
	}
	
	public Color3f getDiffuseColor()
	{
		return diffuseColor;
	}
	
	public float getShininess()
	{
		return shininess;
	}
	
	public float getReflectivity()
	{
		return reflectivity;
	}
	
	public void setReflectivity(float r)
	{
		reflectivity = r;
	}
	
	public float getTransparency()
	{
		return transparency;
	}
	
	public void setTransparency(float t)
	{
		transparency = t;
	}
}
